package com.wakyde.controller;

import com.wakyde.dao.EmployeeDao;
import com.wakyde.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Collection;

@Controller
public class Customers {

    @Autowired
    public EmployeeDao employeeDao;

    @RequestMapping("/customers.html")
    public String index(Model model){
        Collection<Employee> allEmployee = employeeDao.getAllEmployee();
        model.addAttribute("allEmployee", allEmployee);
        return "customers";
    }
}
